package com.rentdvd.ws;

public class RentDVDImplProxy implements com.rentdvd.ws.RentDVDImpl {
  private String _endpoint = null;
  private com.rentdvd.ws.RentDVDImpl rentDVDImpl = null;
  
  public RentDVDImplProxy() {
    _initRentDVDImplProxy();
  }
  
  public RentDVDImplProxy(String endpoint) {
    _endpoint = endpoint;
    _initRentDVDImplProxy();
  }
  
  private void _initRentDVDImplProxy() {
    try {
      rentDVDImpl = (new com.rentdvd.ws.RentDVDImplServiceLocator()).getRentDVDImpl();
      if (rentDVDImpl != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)rentDVDImpl)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)rentDVDImpl)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (rentDVDImpl != null)
      ((javax.xml.rpc.Stub)rentDVDImpl)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public com.rentdvd.ws.RentDVDImpl getRentDVDImpl() {
    if (rentDVDImpl == null)
      _initRentDVDImplProxy();
    return rentDVDImpl;
  }
  
  public boolean register(java.lang.String username, java.lang.String password) throws java.rmi.RemoteException{
    if (rentDVDImpl == null)
      _initRentDVDImplProxy();
    return rentDVDImpl.register(username, password);
  }
  
  public java.lang.String getCatalog() throws java.rmi.RemoteException{
    if (rentDVDImpl == null)
      _initRentDVDImplProxy();
    return rentDVDImpl.getCatalog();
  }
  
  public boolean authenticate(java.lang.String name, java.lang.String password) throws java.rmi.RemoteException{
    if (rentDVDImpl == null)
      _initRentDVDImplProxy();
    return rentDVDImpl.authenticate(name, password);
  }
  
  public java.lang.String recommendMovie(java.lang.String userName, java.lang.String city) throws java.rmi.RemoteException{
    if (rentDVDImpl == null)
      _initRentDVDImplProxy();
    return rentDVDImpl.recommendMovie(userName, city);
  }
  
  public boolean addWatchedFilms(java.lang.String userName, int[] filmArray) throws java.rmi.RemoteException{
    if (rentDVDImpl == null)
      _initRentDVDImplProxy();
    return rentDVDImpl.addWatchedFilms(userName, filmArray);
  }
  
  public java.lang.String getWatchedMoviesAsXML(java.lang.String username) throws java.rmi.RemoteException{
    if (rentDVDImpl == null)
      _initRentDVDImplProxy();
    return rentDVDImpl.getWatchedMoviesAsXML(username);
  }
  
  
}